<?php
/**
 * @category ContentEngine
 * @package Goatherd\Content\Engine
 *
 * @author Copyright (c) 2012 Maik Penz <maik@phpkuh.de>
 * @version $Id: ItemCollection.php 86 2012-03-27 22:40:44Z maik@phpkuh.de $
 *
 * This file is part of Goatherd library.
 *
 * Goatherd library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * Goatherd library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Goatherd library. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Goatherd\Content\Engine\Queue;

use Goatherd\Commons\Collection\Collection;

/**
 *
 * @todo add useful batch-operations
 *
 * @category ContentEngine
 * @package Goatherd\Content\Engine\Reader
 * @subpackage Queue
 */
class ItemCollection
extends Collection
{
    /**
     * Entity domain.
     *
     * @var string
     */
    protected $_entityNamespace = '\\Goatherd\\Content\\Engine\\Queue\\IItem';

    /**
     * Save all items that contain changes.
     *
     */
    public function persistAll()
    {
        foreach ($this as $item) {
            $item->persist();
        }

        return $this;
    }
}